package com.demo.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BalenceController {

    @Value("${server.port}")
    int port;

    @Value("${balance.timeweight}")
    int timeweight;

    int count = 0;
    @RequestMapping("/balence")
    @ResponseBody
    public String sayHello() throws InterruptedException {
        System.out.println(port + " received,times : " + count++);
        Thread.currentThread().sleep(timeweight * 100);
        return "hello world";
    }
}
